Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unsubscribe better. Fixes error when host uses drag / mouse events #82

Merged
merged 1 commit into from
Aug 10, 2018
Merged

Conversation

ronlawrence3
Copy link
Contributor

This fixes a failure when the host element has handlers for drag events, and only unsubscribes the subscriptions if they were subscribed. I was getting this during drag events:

GroupElementComponent.html:10 ERROR TypeError: Cannot read property 'unsubscribe' of undefined
    at ResizableDirective.push../node_modules/angular-resizable-element/fesm5/angular-resizable-element.js.ResizableDirective.ngOnDestroy (angular-resizable-element.js:580)
    at callProviderLifecycles (core.js:9268)

I'm not sure why the ngOnDestroy was called without the subscriptions being there, but this fixes the error.

@ronlawrence3
Copy link
Contributor Author

Copy link
Owner

@mattlewis92 mattlewis92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I've seen this kind of error before as well, makes sense. Travis is having some issues at the moment, will merge once it's backup

@codecov-io
Copy link

codecov-io commented Aug 10, 2018

Codecov Report

Merging #82 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #82      +/-   ##
=========================================
- Coverage   94.83%   94.8%   -0.04%     
=========================================
  Files           4       4              
  Lines         310     308       -2     
  Branches       48      48              
=========================================
- Hits          294     292       -2     
  Misses          8       8              
  Partials        8       8
Impacted Files Coverage Δ
src/resizable.directive.ts 95.13% <100%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 395d34c...9634a28. Read the comment docs.

@mattlewis92 mattlewis92 merged commit 56e463b into mattlewis92:master Aug 10, 2018
@mattlewis92
Copy link
Owner

Released as 3.2.2, thanks for your contribution! 😄

@ronlawrence3
Copy link
Contributor Author

👍 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants